{% extends "base.html" %}

{% block script %}
    <script src="/static/js/cms2/gallery.js"></script>
{% end %}

{% block settings %}
    {% set menu_selected = 'topic' %}
{% end %}

{% block main %}
<div class="main_hd">
    <h2>话题</h2>

    <div class="title_tab" id="topTab">
        <ul class="tab_navs title_tab" data-index="0">
        <li data-index="0" class="tab_nav first js_top " data-id="send"><a href="/cms2/topic">话题管理</a></li>
        <li data-index="1" class="tab_nav js_top selected" data-id="list"><a href="/cms2/topic/gallery">轮播图规则</a></li>
        </ul>
    </div>
    <div class="extra_info search_bar" id="searchBar">
        <span class="frm_input_box search with_del append ">
            <a class="del_btn jsSearchInputClose" href="javascript:" style="display:none">
                <i class="icon_search_del"></i>&nbsp;
            </a>
            <a href="javascript:" class="frm_input_append jsSearchInputBt">
                <i class="icon16_common search_gray">搜索</i>&nbsp;
            </a>
        <input type="text" value="" class="frm_input jsSearchInput" placeholder="消息内容">
        </span>
    </div>
</div>
<div class="main_bd">
    <div class="topic-box">
        <div class="t-panel gallery-panel">
            <div class="t-panel-heading">
                <div class="t-panel-title">
                    <select id="select-prov">
                        <option value="0">公共频道</option>
                        <option value="1">其它频道</option>
                    </select>
                </div>
                <div class="t-edit-box">
                    <button class="btn btn_mini" id="refresh-g">刷新</button>
                    <button class="btn btn_mini" id="edit-g">编辑</button>
                    <button class="btn btn_mini" id="save-g" style="display: none">保存</button>
                    <button class="btn btn_mini" id="cancel-g" style="display: none">取消</button>
                </div>
            </div>
            <div class="panel-body">
                <div class="gallery-list clearfix">

                </div>
                <div class="new-gallery-panel" style="display: none">
                    <div class="panel-body">
                        <div class="">
                            频道：<span class="prov-tip">公共</span>
                        </div>
                        <label>类型:</label>
                        <div class="form-inline">
                            <div class="radio">
                                <label>
                                    <input type="radio" name="new-type" value="0" checked>
                                    0.推荐
                                </label>
                            </div>
                            <div class="form-group">
                                <input type="text" class="form-control" id="sugg-topic" placeholder="推荐topicid">
                            </div>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" name="new-type" value="1">
                                1.公共最热
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" name="new-type" value="2">
                                2.当前频道最热
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" name="new-type" value="3">
                                3.随机
                            </label>
                        </div>
                        <button class="btn btn_small add-gallery">提交</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% end %}

{% block template %}
<script type="text/template" id="topic-gallery-template">
    <div class="gallery-item">
        <div class="panel-body hot-info">
            <div><%- type2txt[gtype] %></div>
            <% if(gtype == 0) { %>
            <div>topicid: <%- remark %></div>
            <% } %>
            <input type="hidden" name="gtype" value="<%- gtype %>">
            <input type="hidden" name="remark" value="<%- remark %>">
            <div class="del-gallery-box" style="display: none">
                <a class="del-gallery" href="#">删除</a>
            </div>
        </div>
    </div>
</script>
{% end %}